package com.jeesite.modules.logistics.service.updatecarframenumber;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.logistics.dao.updatecarframenumber.LogisticsEndLockDao;
import com.jeesite.modules.logistics.dao.updatecarframenumber.VehicleLogisticsStatusQueryDao;
import com.jeesite.modules.order.dao.serviceorder.ServiceOrderDao;
import com.jeesite.modules.order.dao.serviceorder.ServiceOrderDetailDao;
import com.jeesite.modules.order.entity.serviceorder.ServiceOrder;
import com.jeesite.modules.order.entity.serviceorder.ServiceOrderDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
public class VehicleLogisticsStatusQueryService extends CrudService<ServiceOrderDao, ServiceOrder> {

    @Autowired
    private VehicleLogisticsStatusQueryDao vehicleLogisticsStatusQueryDao;
    @Autowired
    private ServiceOrderDetailDao serviceOrderDetailDao;
    public Page<ServiceOrder> updateNumber(ServiceOrder serviceOrder) {
        Page<ServiceOrder> page = (Page<ServiceOrder>) serviceOrder.getPage();
//        page.setPageSize(Page.PAGE_SIZE_NOT_PAGING);    // 不分页，返回全部数据。
//        page.setCount(Page.COUNT_NOT_COUNT);            // 不执行Count，不查询总数。
//        page.setCount(Page.COUNT_ONLY_COUNT);            // 只Count数据，不返回数据，通过 page.getCount()获取
        page.setList(vehicleLogisticsStatusQueryDao.updateNumber(serviceOrder));
        //Page<ServiceOrder> serviceOrders = vehicleLogisticsStatusQueryDao.updateNumber(serviceOrder);
        return page;
    }
    public void updateDetail(ServiceOrderDetail serviceOrderDetail){

        serviceOrderDetailDao.updateDetail(serviceOrderDetail);
    }
}
